"""
Project Name : api_automation_framework
File Name : xml_demo.py
Author : lldhsds
Date : 2024/12/28 12:05
Description: /xml, 返回一个 XML 格式的响应，用于测试服务端返回 XML 格式的情况。
"""

import requests

# GET: /xml
# Returns a simple XML document.
# parameters: None
# response: 200(An XML page.)

def xml_demo():
    url = "http://httpbin.org/xml"
    headers = {'content-type': 'application/xml'}
    response = requests.get(url, headers=headers)
    print(response.status_code)
    print(response.text)
    print(response.headers)

xml_demo()
